<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>操作日志查看</title>
    <link rel="stylesheet" href="/bootstrap-3.3.7-dist/css/bootstrap.css">
</head>
<body>

<div>
    <P>
    <h2>操作日志查看</h2></P>

    <div>
        <form action="/TrackLog/findAll2" method="get">
            <input class="layui-input" name="name" placeholder="name"/>
            <input class="layui-input" name="operationTypeEnum" placeholder="operationTypeEnum"/>
            <input class="layui-input" name="startTime" placeholder="startTime"/>
            <input class="layui-input" name="endTime" placeholder="endTime"/>
            <button id="search" >查询</button>
            <a href="/TrackLog/findAllToDate?startTime=2018-10-28&endTime=2018-11-03">时间范围查询</a>
            <a href="/TrackLog/findAllToDate2?startTime=2018-10-28&endTime=2018-11-03">时间范围查询</a>
        </form>
    </div>
    <form >
        <table class="table table-bordered">
            <thead>
            <tr>
                <th style="width:100px;">sequence</th>
                <th>userId</th>
                <th>userName</th>
                <th>operationTypeEnum</th>
                <th>operationMessage</th>
                <th>url</th>
                <th>time</th>
                <th>operation</th>
            </tr>
            </thead>
            <tbody>
            <th:block th:each="c,lstat:${DataList}">
                <tr>
                    <td><span th:text="${lstat.index+1}"></span><input type="hidden" th:value="${c.id}"></td>
                    <td><label th:text="${c.userId}"></label></td>
                    <td><label th:text="${c.userName}"></label></td>
                    <td><label th:text="${c.operationType}"></label></td>
                    <td><label th:text="${c.logMessage}"></label></td>
                    <td><label th:text="${c.url}"></label></td>
                    <td><label th:if="${c.createTime != null}" th:text="${#dates.format(c.createTime,'yyyy-MM-dd HH:mm:ss')}"></label></td>
                    <td>
                        <a href="javascript:void(0)" th:attr="field=${c.id}" onclick="btnLook(this)">查看详细信息</a>
                        <!--<button type="button" th:attr="field=${c.id}" onclick="btnLook(this)">查看详细信息</button>-->
                    </td>
                </tr>
            </th:block>
            </tbody>
        </table>
        <div th:replace="_pager.html"></div>
    </form>
</div>
<script src="/js/jquery-3.3.1.min.js"></script>
<script src="/layui/layui.js"></script>
<script src="/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
<script type="text/javascript">
    var layer ;
    $(function(){
        layui.use('layer', function(){
            var layer = layui.layer;
            layer.msg('hello');
        });
    })
    function btnLook(e){
        var id = $(e).attr("field");
        layer.open({
            title:"日志详细信息",
            content:"/TrackLog/findOne?id="+id,
            type:2,
            area:["80%","80%"],
        })
    }

</script>
</body>
</html>